package testtool;

import java.io.*;
import java.util.ArrayList;

public class Filemanage {
	public String []filename;
	public String []directory;
	 public void getNames(String path) {
		  File file = new File(path);
		  File files[] = null;
		  ArrayList<String>   dt   =   new   ArrayList<String>(); 
		  ArrayList<String>   fn  =   new   ArrayList<String>(); 
		  if (file.isDirectory()) {
		   files = file.listFiles();
		
		  }
		  for (int i = 0; i < files.length; i++)
			  if(files[i].isDirectory())
			   dt.add(files[i].getName());
			 
			  else			
				  fn.add(files[i].getName());
			
		  filename=fn.toArray(new String [0]);
		 directory=dt.toArray(new String [0]);
		 
		 }
	public String[] getFilename() {
		return filename;
	}
	public void setFilename(String[] filename) {
		this.filename = filename;
	}
	public String[] getDirectory() {
		return directory;
	}
	public void setDirectory(String[] directory) {
		this.directory = directory;
	}
		 
		}

class MyFileFilter implements FileFilter{

	public boolean accept(File pathname) {
		// TODO Auto-generated method stub
		String filenames=pathname.getName().toLowerCase();
		if(filenames.contains(".jsp"))
		{
			return true;
		}
		else
		return false;
	}
	
}